﻿namespace PMS.Client.FrmUser
{
    using PMS.BLL;
    using PMS.Common;
    using PMS.Model;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class FrmAdd : Form
    {
        private DateTimePicker BirthDay;
        private TextBox Birthplace;
        private Button btnCancel;
        private Button btnSave;
        private IContainer components = null;
        private TextBox Degree;
        private DateTimePicker GraduationDate;
        private TextBox GraduationSchoole;
        private GroupBox groupBox1;
        private TextBox HighestEducation;
        private TextBox ID;
        private DateTimePicker JoinPartDate;
        private DateTimePicker JoinWorkDate;
        private Label label1;
        private Label label10;
        private Label label11;
        private Label label12;
        private Label label13;
        private Label label14;
        private Label label15;
        private Label label2;
        private Label label3;
        private Label label30;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private Label label8;
        private Label label9;
        private Label lbTitle;
        private TextBox Major;
        private TextBox Nation;
        private ComboBox Politics;
        private ComboBox Sex;
        private TextBox UserName;

        public FrmAdd()
        {
            this.InitializeComponent();
        }

        private void BackUpInfoBind()
        {
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btnJobTitle_Click(object sender, EventArgs e)
        {
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            if (this.UserName.Text.Trim() == "")
            {
                MessageBox.Show("用名不能为空！");
                this.UserName.Focus();
            }
            else if (this.ID.Text.Trim() == "")
            {
                MessageBox.Show("身份证号不能为空！");
                this.ID.Focus();
            }
            else
            {
                UserChangeLog log2 = new UserChangeLog {
                    IsLeave = 0,
                    UserName = this.UserName.Text,
                    Sex = this.Sex.Text,
                    Birthday = new DateTime?(this.BirthDay.Value),
                    Birthplace = this.Birthplace.Text,
                    Nation = this.Nation.Text,
                    ID = this.ID.Text,
                    Politics = this.Politics.Text,
                    JoinPartDate = new DateTime?(this.JoinPartDate.Value),
                    GraduationSchoole = this.GraduationSchoole.Text,
                    GraduationDate = new DateTime?(this.GraduationDate.Value),
                    JoinWorkDate = new DateTime?(this.JoinWorkDate.Value),
                    Major = this.Major.Text,
                    Degree = this.Degree.Text,
                    HighestEducation = this.HighestEducation.Text,
                    Photo = "",
                    AddDate = new DateTime?(DateTime.Now),
                    AddUser = PMS.Common.Keys.Admin.LoginName,
                    UpdateDate = new DateTime?(DateTime.Now),
                    UpdateUser = PMS.Common.Keys.Admin.LoginName,
                    CheckState = "未审核",
                    LogType = "新增"
                };
                UserChangeLog model = log2;
                UserChangeLogBLL gbll = new UserChangeLogBLL();
                try
                {
                    if (gbll.Add(model) > 0)
                    {
                        MessageBox.Show("添加成功，等待审核！");
                        base.DialogResult = DialogResult.OK;
                        base.Close();
                    }
                    else
                    {
                        MessageBox.Show("添加失败,请检查后重试！");
                    }
                }
                catch (Exception exception)
                {
                    MessageBox.Show("添加失败，发生一个错误：" + exception.Message);
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmAdd_Load(object sender, EventArgs e)
        {
            this.Sex.SelectedIndex = 0;
            this.Politics.SelectedIndex = 0;
            this.PositionLevelBind();
        }

        private void InitializeComponent()
        {
            ComponentResourceManager manager = new ComponentResourceManager(typeof(FrmAdd));
            this.label8 = new Label();
            this.UserName = new TextBox();
            this.label7 = new Label();
            this.label30 = new Label();
            this.groupBox1 = new GroupBox();
            this.label15 = new Label();
            this.JoinWorkDate = new DateTimePicker();
            this.label14 = new Label();
            this.Major = new TextBox();
            this.label13 = new Label();
            this.Degree = new TextBox();
            this.label12 = new Label();
            this.HighestEducation = new TextBox();
            this.label11 = new Label();
            this.GraduationDate = new DateTimePicker();
            this.label10 = new Label();
            this.GraduationSchoole = new TextBox();
            this.label9 = new Label();
            this.JoinPartDate = new DateTimePicker();
            this.label6 = new Label();
            this.Politics = new ComboBox();
            this.label5 = new Label();
            this.Nation = new TextBox();
            this.label4 = new Label();
            this.Birthplace = new TextBox();
            this.label3 = new Label();
            this.ID = new TextBox();
            this.BirthDay = new DateTimePicker();
            this.label2 = new Label();
            this.Sex = new ComboBox();
            this.label1 = new Label();
            this.btnCancel = new Button();
            this.btnSave = new Button();
            this.lbTitle = new Label();
            this.groupBox1.SuspendLayout();
            base.SuspendLayout();
            this.label8.AutoSize = true;
            this.label8.Location = new Point(0x27, 0x17);
            this.label8.Name = "label8";
            this.label8.Size = new Size(0x1d, 12);
            this.label8.TabIndex = 10;
            this.label8.Text = "姓名";
            this.UserName.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.UserName.BorderStyle = BorderStyle.FixedSingle;
            this.UserName.Location = new Point(0x4a, 0x13);
            this.UserName.Name = "UserName";
            this.UserName.Size = new Size(0x87, 0x15);
            this.UserName.TabIndex = 11;
            this.label7.AutoSize = true;
            this.label7.Location = new Point(15, 0x37);
            this.label7.Name = "label7";
            this.label7.Size = new Size(0x35, 12);
            this.label7.TabIndex = 12;
            this.label7.Text = "身份证号";
            this.label30.AutoSize = true;
            this.label30.ForeColor = Color.Red;
            this.label30.Location = new Point(0xd5, 0x17);
            this.label30.Name = "label30";
            this.label30.Size = new Size(11, 12);
            this.label30.TabIndex = 0x24;
            this.label30.Text = "*";
            this.groupBox1.Controls.Add(this.label15);
            this.groupBox1.Controls.Add(this.label30);
            this.groupBox1.Controls.Add(this.JoinWorkDate);
            this.groupBox1.Controls.Add(this.label14);
            this.groupBox1.Controls.Add(this.Major);
            this.groupBox1.Controls.Add(this.label13);
            this.groupBox1.Controls.Add(this.Degree);
            this.groupBox1.Controls.Add(this.label12);
            this.groupBox1.Controls.Add(this.HighestEducation);
            this.groupBox1.Controls.Add(this.label11);
            this.groupBox1.Controls.Add(this.GraduationDate);
            this.groupBox1.Controls.Add(this.label10);
            this.groupBox1.Controls.Add(this.GraduationSchoole);
            this.groupBox1.Controls.Add(this.label9);
            this.groupBox1.Controls.Add(this.JoinPartDate);
            this.groupBox1.Controls.Add(this.label6);
            this.groupBox1.Controls.Add(this.Politics);
            this.groupBox1.Controls.Add(this.label5);
            this.groupBox1.Controls.Add(this.Nation);
            this.groupBox1.Controls.Add(this.label4);
            this.groupBox1.Controls.Add(this.Birthplace);
            this.groupBox1.Controls.Add(this.label3);
            this.groupBox1.Controls.Add(this.ID);
            this.groupBox1.Controls.Add(this.BirthDay);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.Sex);
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.UserName);
            this.groupBox1.Controls.Add(this.label8);
            this.groupBox1.ForeColor = SystemColors.WindowText;
            this.groupBox1.Location = new Point(12, 0x2c);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x23e, 0x10d);
            this.groupBox1.TabIndex = 1;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "基本信息";
            this.label15.AutoSize = true;
            this.label15.ForeColor = Color.Red;
            this.label15.Location = new Point(0xd7, 0x37);
            this.label15.Name = "label15";
            this.label15.Size = new Size(11, 12);
            this.label15.TabIndex = 0x25;
            this.label15.Text = "*";
            this.JoinWorkDate.CalendarMonthBackground = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.JoinWorkDate.Location = new Point(0x185, 0xd4);
            this.JoinWorkDate.Name = "JoinWorkDate";
            this.JoinWorkDate.Size = new Size(0x87, 0x15);
            this.JoinWorkDate.TabIndex = 0x24;
            this.label14.AutoSize = true;
            this.label14.Location = new Point(0x132, 0xd8);
            this.label14.Name = "label14";
            this.label14.Size = new Size(0x4d, 12);
            this.label14.TabIndex = 0x23;
            this.label14.Text = "参加工作时间";
            this.Major.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.Major.BorderStyle = BorderStyle.FixedSingle;
            this.Major.Location = new Point(0x4a, 0xb2);
            this.Major.Name = "Major";
            this.Major.Size = new Size(0x87, 0x15);
            this.Major.TabIndex = 0x22;
            this.label13.AutoSize = true;
            this.label13.Location = new Point(0x27, 0xb6);
            this.label13.Name = "label13";
            this.label13.Size = new Size(0x1d, 12);
            this.label13.TabIndex = 0x21;
            this.label13.Text = "专业";
            this.Degree.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.Degree.BorderStyle = BorderStyle.FixedSingle;
            this.Degree.Location = new Point(0x185, 180);
            this.Degree.Name = "Degree";
            this.Degree.Size = new Size(0x87, 0x15);
            this.Degree.TabIndex = 0x20;
            this.label12.AutoSize = true;
            this.label12.Location = new Point(0x160, 0xb8);
            this.label12.Name = "label12";
            this.label12.Size = new Size(0x1d, 12);
            this.label12.TabIndex = 0x1f;
            this.label12.Text = "学位";
            this.HighestEducation.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.HighestEducation.BorderStyle = BorderStyle.FixedSingle;
            this.HighestEducation.Location = new Point(0x4a, 210);
            this.HighestEducation.Name = "HighestEducation";
            this.HighestEducation.Size = new Size(0x87, 0x15);
            this.HighestEducation.TabIndex = 30;
            this.label11.AutoSize = true;
            this.label11.Location = new Point(15, 210);
            this.label11.Name = "label11";
            this.label11.Size = new Size(0x35, 12);
            this.label11.TabIndex = 0x1d;
            this.label11.Text = "最高学历";
            this.GraduationDate.CalendarMonthBackground = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.GraduationDate.Location = new Point(0x185, 0x93);
            this.GraduationDate.Name = "GraduationDate";
            this.GraduationDate.Size = new Size(0x87, 0x15);
            this.GraduationDate.TabIndex = 0x1c;
            this.label10.AutoSize = true;
            this.label10.Location = new Point(0x14c, 0x97);
            this.label10.Name = "label10";
            this.label10.Size = new Size(0x35, 12);
            this.label10.TabIndex = 0x1b;
            this.label10.Text = "毕业时间";
            this.GraduationSchoole.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.GraduationSchoole.BorderStyle = BorderStyle.FixedSingle;
            this.GraduationSchoole.Location = new Point(0x4a, 0x92);
            this.GraduationSchoole.Name = "GraduationSchoole";
            this.GraduationSchoole.Size = new Size(0x87, 0x15);
            this.GraduationSchoole.TabIndex = 0x1a;
            this.label9.AutoSize = true;
            this.label9.Location = new Point(13, 0x95);
            this.label9.Name = "label9";
            this.label9.Size = new Size(0x35, 12);
            this.label9.TabIndex = 0x19;
            this.label9.Text = "毕业学校";
            this.JoinPartDate.CalendarMonthBackground = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.JoinPartDate.Location = new Point(0x185, 0x70);
            this.JoinPartDate.Name = "JoinPartDate";
            this.JoinPartDate.Size = new Size(0x87, 0x15);
            this.JoinPartDate.TabIndex = 0x18;
            this.label6.AutoSize = true;
            this.label6.Location = new Point(0x13a, 0x74);
            this.label6.Name = "label6";
            this.label6.Size = new Size(0x47, 12);
            this.label6.TabIndex = 0x17;
            this.label6.Text = "入党/团时间";
            this.Politics.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.Politics.DropDownStyle = ComboBoxStyle.DropDownList;
            this.Politics.FlatStyle = FlatStyle.Flat;
            this.Politics.FormattingEnabled = true;
            this.Politics.ItemHeight = 12;
            this.Politics.Items.AddRange(new object[] { "请选择", "中共党员", "共青团员", "其它" });
            this.Politics.Location = new Point(0x4a, 0x73);
            this.Politics.Name = "Politics";
            this.Politics.Size = new Size(0x87, 20);
            this.Politics.TabIndex = 0x16;
            this.label5.AutoSize = true;
            this.label5.Location = new Point(15, 0x76);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x35, 12);
            this.label5.TabIndex = 0x15;
            this.label5.Text = "政治面貌";
            this.Nation.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.Nation.BorderStyle = BorderStyle.FixedSingle;
            this.Nation.Location = new Point(0x185, 0x51);
            this.Nation.Name = "Nation";
            this.Nation.Size = new Size(0x87, 0x15);
            this.Nation.TabIndex = 20;
            this.label4.AutoSize = true;
            this.label4.Location = new Point(0x164, 0x55);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x1d, 12);
            this.label4.TabIndex = 0x13;
            this.label4.Text = "民族";
            this.Birthplace.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.Birthplace.BorderStyle = BorderStyle.FixedSingle;
            this.Birthplace.Location = new Point(0x4a, 0x53);
            this.Birthplace.Name = "Birthplace";
            this.Birthplace.Size = new Size(0x87, 0x15);
            this.Birthplace.TabIndex = 0x12;
            this.label3.AutoSize = true;
            this.label3.Location = new Point(0x27, 0x57);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x1d, 12);
            this.label3.TabIndex = 0x11;
            this.label3.Text = "籍贯";
            this.ID.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.ID.BorderStyle = BorderStyle.FixedSingle;
            this.ID.Location = new Point(0x4a, 0x33);
            this.ID.Name = "ID";
            this.ID.Size = new Size(0x87, 0x15);
            this.ID.TabIndex = 0x10;
            this.BirthDay.CalendarMonthBackground = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.BirthDay.Location = new Point(0x185, 0x31);
            this.BirthDay.Name = "BirthDay";
            this.BirthDay.Size = new Size(0x87, 0x15);
            this.BirthDay.TabIndex = 15;
            this.label2.AutoSize = true;
            this.label2.Location = new Point(330, 0x35);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x35, 12);
            this.label2.TabIndex = 14;
            this.label2.Text = "出生年月";
            this.Sex.BackColor = Color.FromArgb(0xd9, 0xea, 0xf7);
            this.Sex.DropDownStyle = ComboBoxStyle.DropDownList;
            this.Sex.FlatStyle = FlatStyle.Flat;
            this.Sex.FormattingEnabled = true;
            this.Sex.ItemHeight = 12;
            this.Sex.Items.AddRange(new object[] { "请选择", "男", "女" });
            this.Sex.Location = new Point(0x185, 0x11);
            this.Sex.Name = "Sex";
            this.Sex.Size = new Size(0x87, 20);
            this.Sex.TabIndex = 13;
            this.label1.AutoSize = true;
            this.label1.Location = new Point(0x162, 0x15);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x1d, 12);
            this.label1.TabIndex = 12;
            this.label1.Text = "性别";
            this.btnCancel.BackColor = Color.White;
            this.btnCancel.FlatStyle = FlatStyle.Popup;
            this.btnCancel.Location = new Point(370, 0x150);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x17);
            this.btnCancel.TabIndex = 7;
            this.btnCancel.Text = "关闭";
            this.btnCancel.UseVisualStyleBackColor = false;
            this.btnCancel.Click += new EventHandler(this.btnCancel_Click);
            this.btnSave.BackColor = Color.White;
            this.btnSave.FlatStyle = FlatStyle.Popup;
            this.btnSave.Location = new Point(0xca, 0x150);
            this.btnSave.Name = "btnSave";
            this.btnSave.Size = new Size(0x4b, 0x17);
            this.btnSave.TabIndex = 6;
            this.btnSave.Text = "保存";
            this.btnSave.UseVisualStyleBackColor = false;
            this.btnSave.Click += new EventHandler(this.btnSave_Click);
            this.lbTitle.BackColor = Color.Gold;
            this.lbTitle.Dock = DockStyle.Top;
            this.lbTitle.Font = new Font("宋体", 14.25f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lbTitle.ForeColor = Color.Black;
            this.lbTitle.Location = new Point(0, 0);
            this.lbTitle.Name = "lbTitle";
            this.lbTitle.Size = new Size(0x257, 0x1f);
            this.lbTitle.TabIndex = 0x38;
            this.lbTitle.Text = "添加人员基本信息";
            this.lbTitle.TextAlign = ContentAlignment.MiddleCenter;
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = AutoScaleMode.Font;
            this.BackColor = Color.FromArgb(0xa4, 0xc4, 0xeb);
            base.ClientSize = new Size(0x257, 0x17a);
            base.Controls.Add(this.lbTitle);
            base.Controls.Add(this.btnCancel);
            base.Controls.Add(this.btnSave);
            base.Controls.Add(this.groupBox1);
            this.DoubleBuffered = true;
            base.FormBorderStyle = FormBorderStyle.FixedSingle;
            base.Icon = (Icon) manager.GetObject("$this.Icon");
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmAdd";
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "添加人员";
            base.Load += new EventHandler(this.FrmAdd_Load);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            base.ResumeLayout(false);
        }

        private void PositionLevelBind()
        {
        }
    }
}

